package HomeWork.Work_02;

import java.util.Scanner;

/**
 * 有一个不多于5位的正整数，求它是几位数，分别打印出每一位数字。
 */
public class Number_03 {
    public static void main(String[] args){
        number();
    }
    public static void number(){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数字");
        int a = sc.nextInt();
        int count = 0, sum;
        if(a > 99999){
            System.out.println("输入出错！");
        }else{
            while(true){
                if(0 == a / 10){
                    sum = a;
                    System.out.println(sum);
                    count ++;
                    break;
                }
                sum = a % 10;
                System.out.print(sum + "\t");
                a /=  10;
                count++;
            }
            System.out.println("这是个" + count + "位数！");
        }
    }
}
